//引入axios请求
import { getBaseCategoryListRequest } from "@/api";

//home 模块化
const state = {
  categoryList: [],
};
const mutations = {
  SET_CATEGORYLIST(state, value) {
    //设置三级分类列表值
    state.categoryList = value;
  },
};
const actions = {
  //请求三级分类列表
  async getcategoryList({ commit }) {
    const result = await getBaseCategoryListRequest();
    commit("SET_CATEGORYLIST", result);
  },
};
const getters = {};

export default {
  //开启命名空间
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
};
